﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Drawing;
namespace TrafficApp
{
    public class Pedestrian : Traffic
    {
        public Pedestrian(Vector tLocation, Vector tVelocity)
            : base(tLocation, tVelocity)
        {
        }

        /// <summary>
        /// move method
        /// </summary>
        public void Move(Crossing cr, List<Pedestrian> pdList)
        {
            //End trip
            if (this.loc.X > 120 && this.velocity.X > 0)
                pdList.Remove(this);
            else if (this.loc.X < 66 && this.velocity.X < 0)
                pdList.Remove(this);

            //on the top left
            if (this.velocity.X > 0 && cr.PedesLights[1].Clr == Color.Red)
            {
                this.loc.X += this.velocity.X;
                this.loc.Y += this.velocity.Y;
            }           
        }
    }
}
